define(["drawable"],function(Drawable){
   
    Level.prototype = new Drawable();
    
    function Level(blockArray, levelNumber, background){
        this.background = background;
        this.levelNumber = levelNumber;
        this.blocks = blockArray;
        this.visibleBlockCount = 0;
        this.hasFinished = function() { return this.visibleBlockCount === 0; };
    }
    
    
    Level.prototype.draw = function(context){
        this.visibleBlockCount = 0;
        for(var i=0; i<this.blocks.length; ++i)   {
            var block = this.blocks[i];
            block.draw(context);
            if(block.isVisible && !block.isUnbreakable){
                this.visibleBlockCount++;                
            }
        }
    };
    
    return Level;
});